/*
 * Plane.h
 *	2d plane
 *	triangle strip built from the a quad (ADCB)
 *  Created on: Oct 11, 2012
 *      Author: pigmal
 */

#ifndef PLANE_H_
#define PLANE_H_

#include <GLES/gl.h>

class Plane
{
public:
	Plane()
	{
		//create a basic rectangle
		QuadVert[0][0] = -1.0f; QuadVert[0][1] = -1.0f; QuadVert[0][2] = 0.0f;	//A
		QuadVert[1][0] = 1.0f;  QuadVert[1][1] = -1.0f; QuadVert[1][2] = 0.0f;	//D
		QuadVert[2][0] = 1.0f;  QuadVert[2][1] = 1.0f;  QuadVert[2][2] = 0.0f;	//C
		QuadVert[3][0] = -1.0f; QuadVert[3][1] = 1.0f;  QuadVert[3][2] = 0.0f;	//B
	}
	~Plane(){;}

	void SetXsize(GLfloat sizeX){;}//TODO getters + setters
	void SetYSize(GLfloat sizeY){;}
	GLfloat GetXSize(){;}
	GLfloat GetYSize(){;}
	void Draw()
	{
	    // Enable vertex array
	    glEnableClientState(GL_VERTEX_ARRAY);
	    // Set pointers to vertex coordinates
	    glVertexPointer(3, GL_FLOAT, 0, QuadVert);

	    //TODO translate,rotate
	}

private:
	static const int QUAD_VERT_1D = 4;
	static const int QUAD_VERT_2D = 3;

    GLfloat QuadVert[QUAD_VERT_1D][QUAD_VERT_2D];	//quad vertices.

};

#endif /* PLANE_H_ */
